home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / newlooklib.lha / newlook / setgflags.c < prev    next >
C/C++ Source or Header  |  1993-11-03  |  469b  |  23 lines

  1. /*
  2.  *  SETGFLAGS.C
  3.  */
  4.  
  5. #include "newlook.h"
  6.  
  7. extern UWORD AddGadget( struct Window *, struct Gadget *, UWORD );
  8. extern VOID RefreshGList( struct Gadget *, struct Window *, struct Requester *, UWORD );
  9.  
  10. void SetGFlags(w,g,flags)
  11. struct Window *w;
  12. struct Gadget *g;
  13. UWORD flags;
  14. {
  15.   USHORT pos= RemoveGadgetSafely(w,g);
  16.  
  17.   g->Flags= flags;
  18.  
  19.   if(pos!=0xFFFF) /* 0xFFFF == (-1)  did we really remove the gadget? */
  20.     AddGadget(w,g, pos);
  21.   RefreshGList(g,w,NULL,1L);
  22. }
  23.